package com.shop.zzh.controller;

import com.shop.zzh.result.ResultForm;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * @program: shop
 * @description: 登录
 * @author: zhuzh
 * @create: 2019-11-06 10:55
 **/
@Api(value = "用户前后台登录控制类")
@RequestMapping("/zzh/login")
@RestController
public class LoginController {

	@ApiOperation(value = "跳转后台登录页面", notes = "跳转后台登录页面")
	@GetMapping("/toLoginPage.html")
	public ModelAndView toLoginPage()throws Exception{
		return new ModelAndView("login/indexLogin");
	}

//	@PostMapping("/login.html")
//	public ResultForm login(String login, String pwd)throws Exception{
//		//查询数据库
//		String token = userService.login(user);
//		return new ResultForm(true,"zzh");
//	}
	@ApiOperation(value = "跳转前台注册页面", notes = "跳转前台注册页面")
	@GetMapping("/registerIndex.html")
	public ModelAndView register()throws Exception{
		return new ModelAndView("login/registerIndex");
	}
	@ApiOperation(value = "跳转前台登录页面", notes = "跳转前台登录页面")
	@GetMapping("/loginIndex.html")
	public ModelAndView loginIndex() throws Exception{
		return new ModelAndView("login/loginIndex");
	}
	/**
	 * 前台主页
	 * @return
	 * @throws Exception
	 */
	@ApiOperation(value = "跳转前台首页", notes = "跳转前台首页")
	@GetMapping("/toIndex.html")
	public ModelAndView toIndex()throws Exception{
		return new ModelAndView("index/index");
	}

	/**
	 * 后台
	 * @return
	 * @throws Exception
	 */
	@ApiOperation(value = "跳转后台首页", notes = "跳转后台首页")
	@GetMapping("/welcome.html")
	public ModelAndView welcome()throws Exception{
		return new ModelAndView("back/welcome");
	}
	@ApiOperation(value = "跳转后台登录页面", notes = "跳转后台登录页面")
	@GetMapping("/indexLogin.html")
	public ModelAndView indexLogin()throws Exception{
		return new ModelAndView("back/mainIndex");
	}

	@GetMapping("/zfbPay.html")
	public ModelAndView zfbPay()throws Exception{
		return new ModelAndView("login/mainIndex");
	}

	@GetMapping("/showVideoList.html")
	public ModelAndView showVideo()throws Exception{
		return new ModelAndView("back/showVideoList");
	}
}
